import matplotlib.pyplot as plt
data = {}
x = []
y = []
c = []
i = 1
for line in open('test.log'):
    arr = line.split(', ')
    x.append(i)
    y.append(arr[0])
    if arr[1] == '0':
        c.append('blue')
    else:
        c.append('red')
    i += 1

plt.figure(figsize=(16,9))
p1 = plt.scatter(x, y, s=2, marker=',', c=c)
p2 = plt.scatter([], [], s=2, marker=',', c='red')
plt.xlabel('Message index')
plt.ylabel('Router id')
plt.legend([p1, p2], ['Add route', 'Remove route'], loc='upper left')
plt.yticks(rotation=0, fontsize=4)
plt.grid(True, axis='x')
plt.show()
# plt.savefig('ana.png')